<rich:modalPanel xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:c="http://java.sun.com/jstl/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich"
    xmlns:jsf="http://www.asiainfo.com/jsf/facelets/tags"
    xmlns:code="http://www.asiainfo.com/code/facelets/tags"
    id="#{panelId}" rendered="#{facesContext.viewRoot ne null}" shadowOpacity="0" resizeable="false" top="50" width="680" autosized="false" onhide="aicommon.jsf.modalPanel.onhide(this)" onshow="aicommon.jsf.modalPanel.onshow(this)" onbeforehide="aicommon.jsf.modalPanel.onbeforehide(this)">
 	
 	<ui:param name="panelList" value="#{panelId}List" />
 	<ui:param name="panelFormRegion" value="#{panelId}FormRegion" />
 	<ui:param name="panelDataTable" value="#{panelId}DataTable" />
 	<ui:param name="innerDataTableScroller" value="#{panelId}DataTableScroller" />
 	
 	<f:facet name="header">
		<ui:insert name="panelHeader">
			HEADER
		</ui:insert>
	</f:facet>
	<f:facet name="controls">
		<div onclick="#{rich:component(panelId)}.hide();" class="owner-mpnl-header-close" />
	</f:facet>
 	<!-- 过程提示 -->
	<a4j:outputPanel id="#{panelList}" layout="block" styleClass="modalPanelContent">
	<a4j:status id="pListFormLoading" for="#{panelFormRegion}" startStyleClass="listLoading" startText="正在处理..."/>
		<a4j:region id="#{panelFormRegion}">
			<div class="queryFields formBox">
		 		<div class="title">
		 			<ui:insert name="queryFieldTitle">
		 				条件区
		 			</ui:insert>
		 			<span class="toggleTool" 
		 				onclick="aicommon.jsf.list.toggleQueryFields('#{rich:clientId(panelId)}');">收起</span>
		 		</div>
				<h:form>
					<ui:insert name="selectorQueryFields">
						查询条件
					</ui:insert>
				</h:form>
			</div>
			<h:form styleClass="form listForm" prependId="false">
				<div class="listHeader">
					<div class="tableButtons">
						<ui:insert name="selectorListButtons">
							<a4j:outputPanel layout="none" rendered="#{not action.singleSelect}">
								<a4j:commandButton value="清空选择"
									action="#{action.selectorDataTable.cleanSelection}"
									styleClass="formBox_commonButton"
									reRender="#{panelDataTable}, #{innerDataTableScroller}" />
								<a4j:commandButton value="返回全部"
						    		styleClass="formBox_commonButton"
						    		onclick="if(aicommon.jsf.list.getDataCount('#{rich:clientId(panelDataTable)}') == 0){aicommon.jsf.messagesMP.show('没有可供选择的记录');return false;}"
									action="#{action.selectAll}" reRender="#{action.reRender}" oncomplete="#{action.oncomplete}; #{rich:component(panelId)}.hide();"/>
							</a4j:outputPanel>
						</ui:insert>
					</div>
					<a4j:outputPanel id="#{innerDataTableScroller}" layout="block" styleClass="dataTableScroller">
						<div class="dataTable-tools">
							<span class="dataTable-tools-count">
								共
								<ui:insert name="innerDataTableCount">
									#{action.datas.size}
								</ui:insert>
								条
							</span>
						</div>
						<div class="dataTable-tools">
							<jsf:rows for="#{panelDataTable}" reRender="#{panelDataTable}, #{innerDataTableScroller}"/>
						</div>
						<div class="dataTable-tools">
							<rich:datascroller maxPages="5" for="#{panelDataTable}" renderIfSinglePage="true" />
						</div>
					</a4j:outputPanel>
					<div style="clear:both"/>
				</div>
				<div class="tableContainer" onselectstart="return false">
					<ui:insert name="selectorDataTable">
						数据表展现
					</ui:insert>
				</div>
				<div class="selectorButtons">
					<ui:insert name="footerButtons">
						<a4j:commandButton value="确定"
				    		styleClass="formBox_commonButton"
				    		onclick="if (!(#{action.singleSelect} ? aicommon.jsf.list.checkSingleSelected('#{panelDataTable}') : aicommon.jsf.list.checkSelected('#{panelDataTable}'))) return false;"
							action="#{action.select}" reRender="#{action.reRender}" oncomplete="#{action.oncomplete}; #{rich:component(panelId)}.hide();"/>
						<input type="button" value="取消" class="formBox_commonButton"
								onclick="#{rich:component(panelId)}.hide();" />
					</ui:insert>
				</div>
			</h:form>
		</a4j:region>
		
		<script type="text/javascript">
			aicommon.jsf.modalPanel.autoHeight('#{rich:clientId(panelId)}');
		</script>
 	</a4j:outputPanel>
</rich:modalPanel>